<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel frontend\models\WebsiteUrl\WebsiteUrlSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '网址库';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="website-url-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('增加网址库', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'website',
            'spider_able',
            [
                'attribute' =>'created_at',
                'value'=>function ($model) {
                    return date('Y-m-d H:i',$model->created_at);
                }
            ],
            [
                'attribute' =>'updated_at',
                'value'=>function ($model) {
                    return date('Y-m-d H:i',$model->updated_at);
                }
            ],

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
